package com.huawei.hms.support.api.hwid;

import com.huawei.hms.common.ApiException;
import com.huawei.hms.support.api.client.ResultCallback;
import com.huawei.hms.support.api.client.Status;
import com.huawei.hms.support.log.HMSLog;
import o.fjo;
import o.fjq;

protected class HuaweiIdApiImpl$SignOutOnCompleteListener implements fjq<Void> {
    private final HuaweiIdApiImpl$SignOutNoConnectPendingResult a;

    public HuaweiIdApiImpl$SignOutOnCompleteListener(HuaweiIdApiImpl$SignOutNoConnectPendingResult huaweiIdApiImpl$SignOutNoConnectPendingResult) {
        this.a = huaweiIdApiImpl$SignOutNoConnectPendingResult;
    }

    public void onComplete(fjo<Void> o_fjo_java_lang_Void) {
        HMSLog.i("HuaweiIdApiImpl", "SignOutOnCompleteListener onComplete");
        if (this.a == null) {
            HMSLog.e("HuaweiIdApiImpl", "signOutResultPendingResult is null");
            return;
        }
        Status status = Status.FAILURE;
        if (o_fjo_java_lang_Void.ˊ()) {
            Object obj = Status.SUCCESS;
        } else {
            Exception ˋ = o_fjo_java_lang_Void.ˋ();
            Status status2;
            if (ˋ == null || !(ˋ instanceof ApiException)) {
                HMSLog.e("HuaweiIdApiImpl", "wrong exception while failed");
                status2 = status;
            } else {
                status2 = new Status(((ApiException) ˋ).getStatusCode());
            }
        }
        ResultCallback callback = this.a.getCallback();
        if (callback != null) {
            callback.onResult(obj);
        } else {
            HMSLog.e("HuaweiIdApiImpl", "set Result callback after signOut completed");
        }
    }
}
